﻿using SqlSugar;
using System;

namespace Model
{
    /// <summary>
    /// lend_return 表实体类
    /// </summary>
    [SugarTable("lend_return")]
    public class LendReturn
    {
        /// <summary>
        /// 编号
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        public long Id { get; set; }

        /// <summary>
        /// 标的id
        /// </summary>
        [SugarColumn(ColumnName = "lend_id")]
        public long? LendId { get; set; }

        /// <summary>
        /// 借款信息id
        /// </summary>
        [SugarColumn(ColumnName = "borrow_info_id")]
        public long BorrowInfoId { get; set; }

        /// <summary>
        /// 还款批次号
        /// </summary>
        [SugarColumn(ColumnName = "return_no")]
        public string ReturnNo { get; set; }

        /// <summary>
        /// 借款人用户id
        /// </summary>
        [SugarColumn(ColumnName = "user_id")]
        public long? UserId { get; set; }

        /// <summary>
        /// 借款金额
        /// </summary>
        [SugarColumn(ColumnName = "amount")]
        public decimal? Amount { get; set; }

        /// <summary>
        /// 计息本金额
        /// </summary>
        [SugarColumn(ColumnName = "base_amount")]
        public decimal? BaseAmount { get; set; }

        /// <summary>
        /// 当前的期数
        /// </summary>
        [SugarColumn(ColumnName = "current_period")]
        public int? CurrentPeriod { get; set; }

        /// <summary>
        /// 年化利率
        /// </summary>
        [SugarColumn(ColumnName = "lend_year_rate")]
        public decimal? LendYearRate { get; set; }

        /// <summary>
        /// 还款方式 1-等额本息 2-等额本金 3-每月还息一次还本 4-一次还本
        /// </summary>
        [SugarColumn(ColumnName = "return_method")]
        public byte? ReturnMethod { get; set; }

        /// <summary>
        /// 本金
        /// </summary>
        [SugarColumn(ColumnName = "principal")]
        public decimal? Principal { get; set; }

        /// <summary>
        /// 利息
        /// </summary>
        [SugarColumn(ColumnName = "interest")]
        public decimal? Interest { get; set; }

        /// <summary>
        /// 本息
        /// </summary>
        [SugarColumn(ColumnName = "total")]
        public decimal? Total { get; set; }

        /// <summary>
        /// 手续费
        /// </summary>
        [SugarColumn(ColumnName = "fee")]
        public decimal? Fee { get; set; }

        /// <summary>
        /// 还款时指定的还款日期
        /// </summary>
        [SugarColumn(ColumnName = "return_date")]
        public DateTime? ReturnDate { get; set; }

        /// <summary>
        /// 实际发生的还款时间
        /// </summary>
        [SugarColumn(ColumnName = "real_return_time")]
        public DateTime? RealReturnTime { get; set; }

        /// <summary>
        /// 是否逾期
        /// </summary>
        [SugarColumn(ColumnName = "is_overdue")]
        public byte? IsOverdue { get; set; }

        /// <summary>
        /// 逾期金额
        /// </summary>
        [SugarColumn(ColumnName = "overdue_total")]
        public decimal? OverdueTotal { get; set; }

        /// <summary>
        /// 是否最后一次还款
        /// </summary>
        [SugarColumn(ColumnName = "is_last")]
        public byte? IsLast { get; set; }

        /// <summary>
        /// 状态（0-未归还 1-已归还）
        /// </summary>
        [SugarColumn(ColumnName = "status")]
        public byte? Status { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "create_time")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnName = "update_time")]
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 逻辑删除(1:已删除，0:未删除)
        /// </summary>
        [SugarColumn(ColumnName = "is_deleted")]
        public byte IsDeleted { get; set; }

    }
}
